package com.ls.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ls.entity.City;
import com.ls.service.ICityService;
import com.ls.utils.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  城市相关接口
 * </p>
 *
 * @author pengyu
 * @since 2020-05-25
 */

@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    ICityService service;

    /** 通过省份编码查询城市列表 */
//    @ApiOperation(value = "通过省份编码查询城市列表")
    @GetMapping(value = "getByProvinceCode")
    public ResultData<City> getByProvinceCode(@RequestParam  Integer provinceCode) {
        return ResultData.successData(service.list(new LambdaQueryWrapper<City>().eq(City::getProvinceCode ,provinceCode)));
    }

}

